/*
 * @Author: hmhvictory 1400628624@qq.com
 * @Date: 2025-07-22 16:42:56
 * @LastEditors: hmhvictory 1400628624@qq.com
 * @LastEditTime: 2025-07-22 16:44:27
 * @FilePath: \实训笔记\day07\demo1.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day07;

public class demo1 {
  public class AverageCalculator {
    // 定义求三个int数平均值的方法
    public static double averageOfThree(int a, int b, int c) {
        // 先将整数转换为double再计算，避免整数除法导致精度丢失
        return (a + b + c) / 3.0;
    }
    // 主方法用于测试averageOfThree方法
    public static void main(String[] args) {
        // 示例用法
        int num1 = 3;
        int num2 = 6;
        int num3 = 9;       
        double result = averageOfThree(num1, num2, num3);
        System.out.println("三个数的平均值是: " + result); // 输出：三个数的平均值是: 6.0
    }
}
}
